package com.example.connecting_dots_android;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;

public class SquareLayout extends LinearLayout {

	public SquareLayout(Context context) {
		super(context);
	}

	 public SquareLayout(Context context, AttributeSet attrs, int defStyle) {
	 super(context, attrs, defStyle);
	 }
	
	 public SquareLayout(Context context, AttributeSet attrs) {
	 super(context, attrs);
	 }
	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		int width = MeasureSpec.getSize(widthMeasureSpec);
		int height = MeasureSpec.getSize(heightMeasureSpec);
		int size = Math.min(width, height);
		super.onMeasure(MeasureSpec.makeMeasureSpec(size, MeasureSpec.EXACTLY),
				MeasureSpec.makeMeasureSpec(size, MeasureSpec.EXACTLY));
	}
}
